const cloud =require('wx-server-sdk');
const dateTimePicker = require('../../utils/dateTimePicker');
cloud.init()
const db=cloud.database()
exports.main=async(event,context)=>{
    const wxContext=cloud.getWXContext();
    var result=await db.collection('accountDetail').add({
        data:{
            type:event.type,
            balance:event.balance,
            remark:event.remark,
            accountId:event.accountId,
            tradeDate:event.tradeDate,
            totalBalance:event.tradeBalance,
            createTime:new Date(),
            updateTime:new Date(),
            _openid:wxContext.OPENID
        }
    });
    
    return result;
}